<?php
declare (strict_types = 1);

namespace hangpu8\hpcms\validate;

use think\Validate;

class AdminRole extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'title'                     => 'require|min:2|max:10',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'title.require'             => ['code' => 1001, 'msg' => '请输入管理员名称'],
        'title.min'                 => ['code' => 1002, 'msg' => '管理员名称至少输入2个字'],
        'title.max'                 => ['code' => 1003, 'msg' => '管理员名称最多可输入10个字'],
    ];
}
